import BaseComponent from "../../app/baseComponent";
import { createSubpageComponent } from "../page.component";
import { AUIPagiantion } from "./pagination";

class UiExamplePagination extends BaseComponent {
    constructor(name) {
        super(name);
        this.methods = {
            onChange(page) {
                console.log(page);
            }
        };
    }
    _template() {
        var self = this;
        return `<div class="${self._name}">
    <aui-pagination :pagination="pagination" @change="onChange"></aui-pagination>
</div>`;
    }
    _mounted() {
        var self = this;
    }
    _data() {
        var ret = {};
        ret.pagination = {
            per_page: 10,    // required
            current_page: 1, // required
            last_page: 12,    // required
        };        
        return ret;
    }
}

AUIPagiantion.install();

window.AUICustomComponents.define("ui-example-pagination", UiExamplePagination);

export default createSubpageComponent(
    `<ui-example-pagination></ui-example-pagination>`
);